import svgCaptcha from 'svg-captcha'
class publicController{
  async getCaptcha (ctx) {
   // 定义svg验证码的格式
  const newCaptcha = svgCaptcha.create({
      size: 4,
      ignoreChars: '0Oo1il',
      color: true,
      noise: Math.floor(Math.random() * 5),
      width: 150,
      height: 38
    })
  ctx.body = {
    code: 200,
    data: newCaptcha.data,
  }
}
}
export default new publicController()